Skip to content

fix(inline): ghost caret in composer box — maya submodule bump + runtime regression test - #24

Closed
davidwed wants to merge 1 commit into
1ay1:masterfrom
davidwed:master
Closed

fix(inline): ghost caret in composer box — maya submodule bump + runtime regression test#24
davidwed wants to merge 1 commit into
1ay1:masterfrom
davidwed:master

Conversation

@davidwed

Copy link
Copy Markdown
Contributor

Bumps maya which parks the hardware cursor below the inline frame on every compose_inline_frame_impl exit path and re-asserts DECTCEM outside the sync block, so a terminal-side mode loss can no longer surface a ghost caret mid-box.

Adds tests/test_ghost_caret_runtime.cpp: a full-runtime PTY repro that drives the agentty app loop and asserts exactly one caret block stays on the composer's first row after wrap/shrink.

…ime regression test

Bumps maya to 77c76b2 which parks the hardware cursor below the inline
frame on every compose_inline_frame_impl exit path and re-asserts
DECTCEM outside the sync block, so a terminal-side mode loss can no
longer surface a ghost caret mid-box.

Adds tests/test_ghost_caret_runtime.cpp: a full-runtime PTY repro that
drives the agentty app loop and asserts exactly one caret block stays
on the composer's first row after wrap/shrink.
1ay1 added a commit that referenced this pull request Aug 31, 2026
…ssion test

Bumps maya to b027882: every compose_inline_frame_impl exit path now
parks the hardware cursor at column 0 of the frame's last wire row (a
bare \r -- row-relative, so safe at any frame anchor and unable to
touch committed scrollback) and re-asserts DECTCEM ?25l OUTSIDE the
?2026 sync block, so a terminal-side rollback or an external ?25h can
no longer surface the cursor mid-box as a ghost caret.

Adds tests/test_ghost_caret_runtime.cpp: a full-runtime PTY repro that
drives the real agentty view()/update() + maya Runtime::render through
wrap/shrink oscillation, the streaming ComponentCache path, the
anti-bounce pad decay, and the welcome-screen first-start subtree at
two heights, asserting exactly one caret block ever sits on the
composer's first text row. Runs with MAYA_GATE_ABORT=1 so any
committed-prefix (scrollback) corruption aborts the test loudly.

Registered as a POSIX-only fold test with SKIP_RETURN_CODE 77
(agentty_fold_test grows a SKIP_CODE argument) so geometry bail-outs
report as ctest SKIP instead of failure.

Test and diagnosis by @davidwed (PR #24). The maya-side fix was
reworked from PR #7's absolute-CUP park to relative parking -- the
original corrupted mid-screen-anchored frames, which this very test's
pad variant caught (stale duplicated composer box after resize).

Co-authored-by: davidwe <davidwe@posteo.de>
@1ay1

1ay1 commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Thanks @davidwed — this landed on master (ecf0030) with you credited as co-author, alongside the maya fix (1ay1/maya@b027882, also co-authored).

Your test_ghost_caret_runtime.cpp is a genuinely valuable harness — full runtime through a real PTY, covering the streaming ComponentCache path, pad decay, and the welcome-screen subtree — and it landed essentially as written. It even caught a real bug: with this PR's maya park (absolute ESC[<row>;1H), the pad-variant phase deterministically fails — the CUP park mis-aims when the frame is anchored mid-screen after the H=10→16 resize, leaving a stale duplicated composer box. The reworked maya fix parks with a row-relative \r instead (the cursor already rests on the last wire row), which keeps the benign anchor without breaking the relative-cursor invariant; with it your test passes end-to-end, all five phases.

Deltas from this PR as filed:

  • maya bump points at the merged upstream SHA (the PR's 77c76b2 wasn't reachable on any remote, so submodule update failed for a fresh clone)
  • SKIP exits unified to 77 and registered via a new SKIP_CODE argument on agentty_fold_test, so geometry bail-outs report as ctest SKIP rather than failure; registration is POSIX-gated (openpty)
  • MAYA_NO_GATE_ABORT=1MAYA_GATE_ABORT=1 (the tripwire is opt-in; the test now aborts loudly on any committed-prefix corruption)

Verified: full run green including the pad + welcome variants, scrollback_oracle_test, and the wire/seam fuzzers. Closing in favor of master.

@1ay1 1ay1 closed this Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants